package com.wzh.example.inheritance;

import java.util.HashMap;

/**
 * @Author zh wang
 * @Create 2025/4/27 20:45
 */
public class Test {
    public static void main(String[] args) {
        Son son = new Son();
        System.out.println("son.num = " + son.num);
        System.out.println("son.static_num = " + son.static_num);
        System.out.println("son.final_num = " + son.final_num);
        System.out.println("son.final_static_num = " + son.final_static_num);
        System.out.println("son.father_num = " + son.father_num);
        System.out.println("son.father_static_num = " + son.father_static_num);
        son.test();
        son.static_test();
        son.father_test();
        son.father_static_test();
        son.interfaceDefaultTest();
        //son.interfaceStaticTest();

        System.out.println();
        Father fa = new Son();
        System.out.println("fa.num = " + fa.num);
        System.out.println("fa.static_num = " + fa.static_num);
        System.out.println("fa.final_num = " + fa.final_num);
        System.out.println("fa.final_static_num = " + fa.final_static_num);
        System.out.println("fa.father_num = " + fa.father_num);
        System.out.println("fa.father_static_num = " + fa.father_static_num);
        fa.test();
        fa.static_test();
        fa.father_test();
        fa.father_static_test();

        System.out.println();
        Son son2 = new Son();
        Father fa2 = son2;
        System.out.println("fa.num = " + fa2.num);
        System.out.println("fa.static_num = " + fa2.static_num);
        System.out.println("fa.final_num = " + fa2.final_num);
        System.out.println("fa.final_static_num = " + fa2.final_static_num);
        System.out.println("fa.father_num = " + fa2.father_num);
        System.out.println("fa.father_static_num = " + fa2.father_static_num);
        fa2.test();
        fa2.static_test();
        fa2.father_test();
        fa2.father_static_test();

        HashMap<Object, Object> map = new HashMap<>();
        int a = 1;
        map.put(a, 3);
        map.keySet().forEach(key -> {
            System.out.println("key = " + key.getClass());
            System.out.println("map.get(key) = " + map.get(key).getClass());
        });
    }
}
